package think.in.spring.bean;

import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import think.in.spring.ioc.overview.domain.User;

import javax.annotation.Resource;

/**
 * 测试方法注入
 */
@Component
@Getter
public class UserHolder2 {

    private User user;

    private User user1;

    @Autowired
    public void initUser(User user) {
        this.user = user;
    }

    @Resource
    public void initUser2(User user) {
        this.user1 = user;
    }

}
